#pragma once

#include "Globals.h"
#include "Graphics.h"
#include "Input.h"
#include "SoundEngine.h"
#include "Board.h"
#include "Player.h"
#include "Cards.h"
#include "Menu.h"

class GAME
{
private:
	GAME():	m_hWnd(NULL)
		,	m_eGameState(GAME_NULL_STATE)
		,	m_dElapsedTime(0)
		,	m_dTotalGameTime(0)
		,	m_bSetTimeElapsed(false)
	{}

	HWND			m_hWnd;
	eGameStates		m_eGameState;
	double			m_dElapsedTime;
	double			m_dTotalGameTime;
	bool			m_bSetTimeElapsed;
	int				m_iCurrPlayer;
	Player*			Player1;
	Player*			Player2;
	Menu*           m_pMenu;
	Deck*			m_pGameDeck;
	DrawList*       m_MenuList;
	DrawList*		m_ObjectDrawList;
	

public:
	static GAME* Engine()
	{
		static GAME myGame;
		return &myGame;
	}

	FunctionReturn Initialize(HWND hWnd,HINSTANCE hInst,HINSTANCE hPrevInst,int nCmdShow,LPSTR lpCmdLine);

	FunctionReturn CleanUp();

	FunctionReturn INITGAME();
	//Draws the data sent to it
	//TODO:: Add  vector variable to arguments list
	FunctionReturn DRAW();

	//Checks all input from the computer and uses it where it
	// is needed
	FunctionReturn INPUT(POINT&);


	//Checks if it has been a second
	//returns true it has been one second
	//returns false it has not been a second yet
	//
	//	extra info: after it returns true because a second has passed
	//				it will return false until it has been a second again
	bool TICK(int Type);

	//Called every update
	double CLOCK();

	FunctionReturn UPDATE();

	FunctionReturn WORK(POINT&);

	//Pass IF(enum) into these functions and it will return whether the game
	// has been won or lost
	//
	//Pass YES(enum) into these functions to tell them to return true 
	// when called with argument IF(enum)
	//
	//Once they return true once if called again with argument IF(enum) they
	// will return false
	bool LOSE(int L);
	bool WIN(int W);
};